<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>vue2</title>
  </head>
  <body>
    <div id="app">
      <ul>
        <li v-for="item in list" :key="item">{{item}}</li>
      </ul>
      <button @click="update">更新</button>

      <!-- <p>{{count}}</p>
      <button @click="add">按钮</button> -->
    </div>
    <script src="./vue.js"></script>
    <script>
      new Vue({
        data() {
          return {
            list: [1, 2, 3, 4, 5, 6, 7],
          };
        },
        methods: {
          update() {
            this.list = [1, 6, 4, 3, 8, 2, 7];
          },
        },
      }).$mount("#app");
      // new Vue({
      //   data() {
      //     return {
      //       count: 0,
      //     };
      //   },
      //   methods: {
      //     add() {
      //       debugger;
      //       this.count++;
      //     },
      //   },
      // }).$mount("#app");
    </script>
  </body>
</html>
